let times = 0
export const request = (params) => {
    times++
    wx.showLoading({
        title: "加载中",
        mask: true,

    });
    return new Promise((resolve, reject) => {


        wx.request({
            ...params,
            success: (result) => {
                resolve(result)
            },
            fail: (error) => {
                reject(error)
            },
            complete: () => {
                times--
                if (times === 0) {
                    wx.hideLoading();

                }
            }
        })

    });
}